package com.acwing.partition12;

import java.io.*;
import java.util.Arrays;

/**
 * @author `RKC`
 * @date 2022/2/10 10:19
 */
public class AC1192奖金_差分约束_spfa {

    private static final int N = 10010, M = 30010;
    private static int[] head = new int[N], ver = new int[M], next = new int[M], w = new int[M], din = new int[N];
    private static int[] q = new int[N], dist = new int[N], cnt = new int[N];
    private static boolean[] st = new boolean[N];

    private static int n = 0, m = 0, idx = 0, qh = 0, qt = 0;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String[] ss = reader.readLine().split(" ");
        n = Integer.parseInt(ss[0]);
        m = Integer.parseInt(ss[1]);
        Arrays.fill(head, -1);
        for (int i = 0; i < m; i++) {
            ss = reader.readLine().split(" ");
            int a = Integer.parseInt(ss[0]), b = Integer.parseInt(ss[1]);
            //a>=b+1
            add(b, a, 1);
            din[a]++;
        }
        //i>=0+100，建立超级源点
        for (int i = 1; i <= n; i++) add(0, i, 100);
        //spfa找正环，没有正环就加上结果
        if (spfa()) writer.write("Poor Xed\n");
        else {
            int sum = 0;
            for (int i = 1; i <= n; i++) sum += dist[i];
            writer.write(sum + "\n");
        }
        writer.flush();
    }

    private static boolean spfa() {
        q[qt++] = 0;
        st[0] = true;
        while (qh <= qt) {
            int u = q[qh++];
            if (qh == N) qh = 0;
            st[u] = false;
            for (int i = head[u]; i != -1; i = next[i]) {
                int v = ver[i];
                if (dist[v] < dist[u] + w[i]) {
                    dist[v] = dist[u] + w[i];
                    cnt[v] = cnt[u] + 1;
                    if (cnt[v] >= n + 1) return true;
                    if (st[v]) continue;
                    q[++qt] = v;
                    if (qt == N) qt = 0;
                    st[v] = true;
                }
            }
        }
        return false;
    }

    private static void add(int a, int b, int c) {
        ver[idx] = b;
        next[idx] = head[a];
        head[a] = idx;
        w[idx++] = c;
    }
}
